Repository navigation
fix(skills): refuse client casts of unlearned or inactive-tree ability skills - #48
Merged
NickMesser merged 3 commits intoOct 27, 2026
Conversation
CSStartSkill still casts a learned ability-tree skill from an inactive tree and an unlearned ability-tree skill that a client-facing source table names. An unlearned ability-tree skill with no client source is refused, but with NO_PERM instead of the 1.2 INVALID_SKILL. Drive CSStartSkill for the class-tree cases and keep item, mount, toggle and ability-less buff / quest / doodad casts as regression controls. Before the fix the focused run is 6 passed, 3 failed; the failures show the cast happening (skill_last_used_ms > 0) and the fallback's result 45 instead of INVALID_SKILL (30), INACTIVE_ABILITY (31) where expected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y skills CSStartSkill trusted the client's skill id: a learned skill from an inactive ability tree still ran, and a client-source table let an unlearned class skill through. A skill with ability_id != 0 now needs that ability active and, when need_learn, the skill or a same-ability-level variant learned. Item, mount, default / common and auto-attack casts stay ahead of the check; ability-less buff, quest, doodad, craft, NPC interaction, slash and housing / shipyard skills are untouched, and a real-data test pins that every id those tables name is ability-less. The 1.2 client enforces this in its action bar (learned / canUse states, URK_TRAINED_SKILL); the C# catch-all cast any skill id. Result codes are INVALID_SKILL (0x1e) for unlearned and INACTIVE_ABILITY (0x1f) for an inactive tree; the client only needs a non-success SCSkillStarted. Focused run: 10 passed, 1 ignored; the ignored compact-data invariant test passes separately. The new test module alone is 6 passed, 3 failed before this fix. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… refusals The client decompile shows the action slot's canUse/learned UI state and the INVALID_SKILL / INACTIVE_ABILITY result codes; it does not show the press itself being refused, and URK_TRAINED_SKILL is a unit-requirement label, not a cast result. Say exactly that. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CSStartSkill accepted a learned ability-tree skill from an inactive ability and an unlearned ability-tree skill that a client-facing source table names. The 1.2 client marks both unusable in its action bar (the action-slot states
canUse/learned; the server answers with the client's own result codesINVALID_SKILL0x1e andINACTIVE_ABILITY0x1f), while the C# handler fell through to a catch-all that cast any skill id with a template.class_skill_denialto the client cast path: a skill withability_id != 0needs that ability among the three active ones (INACTIVE_ABILITY, 0x1f) and, whenneed_learn, the skill or a same-ability-level variant learned (INVALID_SKILL, 0x1e). Item, mount, default / common and auto-attack casts are decided before the check; GM commands use the server skill API.ability_id = 0(5,528 known ids).The exact result codes are our choice; the client only needs a non-success
SCSkillStarted.Validation
nick/rust-rewrite(c6befb58c),cargo test -p aaemu-game --lib class_skill_authorityis 6 passed, 3 failed. The failures show the active-tree unlearned skill cast (fallback result 45,NO_PERM, instead of 30INVALID_SKILL) and both tree cases casting (skill_last_used_ms > 0) whereINACTIVE_ABILITY/INVALID_SKILLare expected.cargo clippy -p aaemu-game --all-targets -- -D warningspasses.AAEMU_COMPACT_DB=D:/aaemu-live/rs-game/Data/compact.sqlite3 cargo test -p aaemu-game --lib real_data_skill_sources_do_not_smuggle_class_tree_skills -- --ignored --nocapture) passes: 15,126 skills, 170 ability-tree skills, 5,528 known ability-less source ids, 8 class-tree source rows (the five documented ids). Every item / buff / mount-attached / craft / NPC interaction / slash / quest / housing / shipyard / default / gimmick / sphere / AI-event id is ability-less.cargo xtask cifromrust/on the PR head: all workspace tests pass, 0 failed; game library 2,888 passed, 0 failed, 150 ignored; testclient 57 library + 16 binary tests; login library 200 passed / 1 ignored; commons 102 passed; formatting, all-target Clippy with-D warnings, the S->C coverage ratchet and the 7 Python tests pass.aaemu-testclient, fresh level-10 Nuian fighter (ability 1 active), same script on both binaries:nick/rust-rewritec6befb5):cast 10134 3492(ability 2,need_learn, named bysphere_doodad_interacts). The server logged13:53:37 [INFO] handlers - StartSkill: Id 10134, flag 0, caster=33000, target=32626; the capture hasSCSkillFiredPacketfor 10134 andSCSkillEndedPacket, no refusal.14:09:10 [INFO] handlers - StartSkill: Id 10134, ...and14:09:10 [WARN] handlers - Client cast of an inactive or unlearned ability skill refused character=Castafter skill_id=10134 result=31; the capture hasSCSkillStartedPacketbody...00011f(skill 10134, flags 1, result 0x1f) and noSCSkillFiredPacket.Limits / not claimed
canUse/learnedstate and the nativeX2::GameClient::SkillAccessorpublisheslearned. The decompile shows this UI state, not a refused press, and the press was not observed in a live client here. Appellation, expedition and family skills were not enumerated in the real-data invariant test.Mountcaster naming the player itself still runs through the mount branch before this check (the deliberate self allowance). Only ability-tree mount skill 13572 exists there, a login-stage fake. A bind-on-pickup item caster can still name a different skill id (the legacy fireplace exception, narrowed for UCC effects). Neither bypass is closed here.Review: an independent reviewer (R1) traced every skill source through
start_skill(the gate sits after the mount, auto-attack, default/common and item branches and only applies toability_id != 0), checked the result codes against the client and the tests' red/green structure: qualified clear. Its wording corrections (UI state, not a proven refused press) are applied.🤖 Generated with Claude Code